package com.sc.nft.service.impl;

import com.sc.nft.dao.*;
import com.sc.nft.entity.RankingBoardHistoryDetails;
import com.sc.nft.entity.vo.GetRankingBoardDetailsVO;
import com.sc.nft.enums.RankingBoardIncomeAndRewardsStatusEnum;
import com.sc.nft.service.UserRankingBoardDetailsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@Service
public class UserRankingBoardDetailsImpl implements UserRankingBoardDetailsService {

    private final RankingBoardHistoryDetailsDao rankingBoardHistoryDetailsDao;
    private final RankingBoardDetailsEvenNumberDao rankingBoardDetailsEvenNumberDao;
    private final RankingBoardDetailsOddNumberDao rankingBoardDetailsOddNumberDao;
    @Override
    public List<GetRankingBoardDetailsVO> getHistoryDetailsByIdAndUserTel(Long id, String userTel) {
        return rankingBoardHistoryDetailsDao.getHistoryDetailsByIdAndUserTel(id,userTel);
    }

    @Override
    public List<GetRankingBoardDetailsVO> getEvenNumberDetailsByIdAndUserTel(Long id, String userTel) {
        return rankingBoardDetailsEvenNumberDao.getEvenNumberDetailsByIdAndUserTel(id,userTel);
    }

    @Override
    public List<GetRankingBoardDetailsVO> getOddNumberDetailsByIdAndUserTel(Long id, String userTel) {
        return rankingBoardDetailsOddNumberDao.getOddNumberDetailsByIdAndUserTel(id,userTel);
    }

    @Override
    public RankingBoardHistoryDetails getOneByRankingBoardConfIdAndRanking(Long confId, Integer ranking) {
        return rankingBoardHistoryDetailsDao.getOneByRankingBoardConfIdAndRanking(confId,ranking);
    }

    @Override
    public Boolean updateRankingBoardDetailsStatusByRankingBoardConfIdAndRanking(Long confId, Integer ranking, RankingBoardIncomeAndRewardsStatusEnum status) {
        return rankingBoardHistoryDetailsDao.updateRankingBoardDetailsStatusByRankingBoardConfIdAndRanking(confId,ranking,status);
    }

}
